Rework the Layout display-rule editor into a single show/hide list#954
Merged
Conversation
JeroenDeDauw
marked this pull request as ready for review
June 27, 2026 19:16
JeroenDeDauw
force-pushed
the
feature/layout-editor-unified-list
branch
from
June 27, 2026 21:19
b42a9dc to
3b665ba
Compare
A Layout with no display rules previously showed every schema property under "Hidden · N" with eye-off icons while also stating "All properties shown in schema order". An empty allowlist means "show all", but the editor rendered the empty case as "nothing shown", so the editor contradicted the actual rendering and the first "Show" click left only a single property visible. Replace the two-section Shown/Hidden editor with a single reorderable list of all schema properties: - Each row has a visibility toggle. The eye / eye-off icon reflects the current state (matching Coda, Notion, Airtable); a tooltip names the action. - Hidden rows dim and sink to the bottom and are not draggable (only shown rows carry a drag handle). - The header shows "N of M shown". - "Show all properties" appears only when a property is hidden, and reveals the hidden properties while preserving the existing order. - The last visible property's hide toggle is disabled (tooltip: "At least one property must be shown"), so the list can never collapse to zero shown and flip back to showing everything. A true "show none" state is left for later (a non-breaking add, since "show all" is persisted as the absence of the key). Domain semantics are unchanged: an empty display-rule list still means "show all properties in schema order". Display-rule editing logic is extracted into a pure, unit-tested module. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
JeroenDeDauw
force-pushed
the
feature/layout-editor-unified-list
branch
from
June 27, 2026 21:46
3b665ba to
ab254f3
Compare
Member
Author
|
Main driver is that originally the UI was very confusing when all properties where shown, as it looked like there where hidden. New: Screencast_20260627_234649.webm |
… drop guard Address review findings on the unified show/hide list: - The last shown property's hide toggle is disabled, but its explanatory title sat on the disabled button, where browsers suppress the native tooltip. Move the title onto a wrapping span (with pointer-events: none on the disabled button) so the "at least one property must be shown" explanation stays reachable on hover; the aria-label stays on the button. - Hidden rows shared the single sortable list as drop targets, so a shown row could be dropped into the hidden region and snap back on re-render. Add a draggable passthrough to useSortable and use it to exclude hidden rows from sorting. - Unify the test fixtures on newTextProperty and a shared newDisplayRules helper, dropping the duplicated local rules() builders. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A Layout with no display rules previously showed every schema property under "Hidden · N" with eye-off icons while also stating "All properties shown in schema order". An empty allowlist means "show all", but the editor rendered the empty case as "nothing shown", so the editor contradicted the actual rendering and the first "Show" click left only a single property visible.
Replace the two-section Shown/Hidden editor with a single reorderable list of all schema properties:
Domain semantics are unchanged: an empty display-rule list still means "show all properties in schema order". Display-rule editing logic is extracted into a pure, unit-tested module.
Notes for reviewers
[].